<?php

    @include_once("conn.php");

    $id = $_GET["id"];
    $chinese = $_GET["chinese"];
    $math = $_GET["math"];
    $english = $_GET["english"];

    $update = "update `grade` set chinese = '$chinese',math='$math',english = '$english' where id = '$id'";

    mysqli_query($conn,$update);

    $rows = mysqli_affected_rows($conn);

    $msg = array();
    if($rows>0){
        $msg["status"] = true;
        $msg["msg"] = "更新成功";
    }else if($rows == 0){
        $msg["status"] = true;
        $msg["msg"] = "更新成功,但是数据未改变";
    }else{
        $msg["status"] = false;
        $msg["msg"] = "更新失败,系统有误,请联系管理员";
        $msg["sql"] = $update;
    }

    echo json_encode($msg);





?>